<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.springframework.org/schema/jdbc">
<head xmlns:th="http://www.thymeleaf.org" th:include="master::head">
    <title>任务队列列表配置</title>

</head>
<body>
<div class="container">
    <div class="row">
        <!--<div class="col-md-4">-->
        <!--</div>-->
        <div class="col-md-12">
            <table id="tb_departments"></table>
        </div>
    </div>


</div>
<script th:inline="javascript">
    /*<![CDATA[*/
    $(function () {
        var queue =/*[[${queue}]]*/;
        //1.初始化Table
        var TableInit = function () {
            var oTableInit = new Object();
            //初始化Table
            oTableInit.Init = function () {
                $('#tb_departments').bootstrapTable($.extend(global.bootstrapTableOptions, {
                    url: global.contextPath + '/queryQueueByName?name=' + queue,         //请求后台的URL（*）
                    method: 'get',                      //请求方式（*）
                    detailView: false,          //是否显示父子表
                    columns: [ {
                        field: 'domain',
                        title: '域名'
                    }, {
                        field: 'method',
                        title: '请求方法'
                    }, {
                        field: 'url',
                        title: '请求URL'
                    }, {
                        field: 'data',
                        title: '请求参数',
                        formatter: function (value, row, index) {
                            return JSON.stringify(row.data);
                        }
                    },
                        {
                            field: 'startTime',
                            title: '加入时间',
                            formatter: function (value, row, index) {
                                if(!row.extendMap) return "未知";
                                var timestamp = row.extendMap.startTime;
                                var d = new Date(timestamp);    //根据时间戳生成的时间对象
                                var date = (d.getFullYear()) + "-" +
                                        (d.getMonth() + 1) + "-" +
                                        (d.getDate()) + " " +
                                        (d.getHours()) + ":" +
                                        (d.getMinutes()) + ":" +
                                        (d.getSeconds());
                                return date;
                            }
                        },
                        {
                        field: 'hashCode',
                        title: '任务标志'
                    }]
                }));
            };
            return oTableInit;
        };
        var oTable = new TableInit();
        oTable.Init();
    });

    /*]]>*/
</script>

</body>
</html>